package org.dregs.pojo;

public class Judge<T> {

    private boolean flag;

    private T data;


    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"flag\":")
                .append(flag);
        sb.append(",\"data\":")
                .append(data);
        sb.append('}');
        return sb.toString();
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Judge() {
        this.flag = false;
    }

    public Judge(T data) {
        this.flag = true;
        this.data = data;
    }

    public Judge(boolean flag, T data) {
        this.flag = flag;
        this.data = data;
    }
}
